﻿using AutoMapper;
using ManagementApi.Models.Person;
using PmSoft;

namespace ManagementApi.Models.Manager
{
    public class ManagerDto
    {
        /// <summary>
        /// 管理员ID 
        ///</summary>
        public int ManagerId { get; set; }
        /// <summary>
        /// 管理员姓名 
        ///</summary>
        public string Name { get; set; }
        /// <summary>
        /// 手机号码 
        ///</summary>
        public string Mobile { get; set; }
        /// <summary>
        /// 身份证号码 
        ///</summary>
        public string Cardno { get; set; }
        /// <summary>
        /// 创建时间 
        /// 默认值: CURRENT_TIMESTAMP
        ///</summary>
        public DateTime CreateTime { get; set; }
    }
    public static partial class ManagerExceptions
    {
        public static ManagerDto AsDto(this Modules.ManagerInfo entity)
        {
            ManagerDto dto = new ManagerDto();
            var mapper = ServiceAccessor.GetService<IMapper>();
            mapper.Map(entity, dto);
            return dto;
        }
    }
}
